﻿using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class RealManager : MonoBehaviour {

    public static RealManager _instance;
    private int _score;

    public Text BestScore;
    public Text Level;

    public int _level = 1;

    public int Score
    {
        get { return _score; }
        set { _score = value; }
    }
    //获取实时积分Text
    public Text realScoreText;

    void Awake()
    {
        _instance = this;
    }

    public void SetScore(int addScore)
    {
        Score += addScore;
        realScoreText.text = "X "+Score.ToString();
        _level = Score / 10 + 1;
        Time.timeScale = _level;
    }

    public void Reset()
    {
        Score = 0;
        realScoreText.text = "X " + Score.ToString();
        _level = 1;
        Time.timeScale = _level;
        Level.text = _level.ToString();
    }
	// Use this for initialization
	void Start () {
        Reset();
	}
	
	// Update is called once per frame
	void Update () {
	
	}
}
